<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
    <style type="text/css">
        #allmap {
            width: 1000px;
            height: 800px;
            overflow: hidden;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
    <script type="text/javascript" src="/js/map/baidu-map.js"></script>
    <title>地图展示2</title>
</head>
<body>
<div>
    <button onclick="localBmapScript()">点我展示地图</button>
</div>
<div id="allmap"></div>
<div id="r-result" style="width:100%; font-size: 14px; line-height: 20px;"></div>
</body>
</html>
<script type="text/javascript">
    //window.onload = localBmapScript;
    window.onload = localBmapScript;

    function localBmapSuccess() {
        map.addEventListener("click", function (m) {
            //所在城市，国外为国家
            var city = this.Yg;
            var opts = {
                width: 200,
                height: 100,
                title: "Hello 你想到这里去吗？"
            }
            var infoWindow = new BMap.InfoWindow(city, opts);
            map.openInfoWindow(infoWindow, m.point);
        });
    }

    /*window.setTimeout(function () {
        map.addEventListener("click", function (m) {
            //所在城市，国外为国家
            var city = this.Yg;
            var opts = {
                width: 200,
                height: 100,
                title: "Hello 你想到这里去吗？"
            }
            var infoWindow = new BMap.InfoWindow(city, opts);
            map.openInfoWindow(infoWindow, m.point);
        });

    },1000)*/
</script>
